package Testing;

import monsterRun.client.MonsterRunClientMain;
import monsterRun.server.MonsterRunServerMainNoGUI;

public class Test1
{

	/**
	 * @param args
	 */
	static Thread serverThread, player1, player2;
	static int waitTime = 4000;

	public static void main(String[] args) throws InterruptedException
	{
		setup();
		serverThread.start();
		Thread.sleep(10000);
		player1.start();
	player2.start();
	}

	public static void setup()
	{
		serverThread = new Thread()
		{
			public void run()
			{
				try
				{
					MonsterRunServerMainNoGUI.main(null);
				}
				catch (Exception e)
				{
					e.printStackTrace();
				}
			}
		};
		serverThread.setName("ServerThread");
		player1 = new Thread()
		{
			public void run()
			{
				try
				{
					Thread.sleep(waitTime);
					MonsterRunClientMain.main(new String[]
					{ "0" });
				}
				catch (Exception e)
				{

					e.printStackTrace();
				}
			}
		};
		player1.setName("__Player1");
		player2 = new Thread()
		{
			public void run()
			{
				try
				{
					Thread.sleep(waitTime);
					MonsterRunClientMain.main(new String[]
					{ "1" });
				}
				catch (Exception e)
				{
					e.printStackTrace();
				}
			}
		};
		player2.setName("__Player2");
	}

}
